﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Iesi.Collections.Generic;

namespace Bunian.Core.BusinessObjects
{
    public class Tender : IPersistedObject
    {
        #region Private Fields
        
        private long _tenderId;
        private TenderType _tenderType;
        private IBeneficiary _beneficiary;
        private IList<Sponsorship> _sponsorships;

        #endregion

        #region " Public Properties "

        public virtual long Id
        {
            get
            {
                return _tenderId;
            }
            set
            {
                _tenderId = value;
            }
        }

        public virtual TenderType Type
        {
            get
            {
                return _tenderType;
            }
            set
            {
                _tenderType = value;
            }
        }

        public virtual IBeneficiary Beneficiary
        {
            get
            {
                return _beneficiary;
            }
            set
            {
                _beneficiary = value;
            }
        }

        public virtual IList<Sponsorship> Sponsorships
        {
            get
            {
                return _sponsorships;
            }
            set
            {
                _sponsorships = value;
            }
        }


        public virtual bool IsSponsored()
        {
            if (null != Sponsorships && Sponsorships.Count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        #endregion
    }
}
